package com.spring.utils.api_v4.pojo.response;

public enum ResultCode {
    /* 成功状态码 */
    SUCCESS(20000, "成功"),
    /* 参数错误 */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1004, "参数缺失"),
    PARAM_FILE_TYPE_ERROR(1005, "文件格式错误"),
    /* 用户错误 2001-2999*/
    USER_NOTLOGGED_IN(2001, "用户未登录"),
    USER_LOGIN_ERROR(2002, "账号不存在或密码错误"),
    USER_EXIST(2003, "该用户已存在"),
    USER_NOT_EXIST(2004, "该用户不存在"),
    USER_PWD_ERR(2005, "密码错误"),
    /* 部门错误 3001-3999 */
    DEPARTMENT_EXIST(3001, "该部门已存在"),
    DEPARTMENT_NOT_EXIST(3002, "该部门不存在"),
    /* 工资任务错误 4001-4999 */
    UMCOMPLETED_WAGE_TASK_EXISTS(4001, "有未完成的任务"),
    TASK_IN_PROGRESS(4002, "任务正在进行中"),
    TASK_IS_LOCKED(4003, "任务已锁定"),
    SALARY_IS_EXCEEDED(4004, "工资超额了"),
    /* 权限错误 5001-5999 */
    NO_PERMISSION(5001, "你没有权限"),
    ROLE_EXIST(5002, "角色已存在"),

    SYSTEM_ERROR(10000, "系统异常，请稍后重试");

    private Integer code;
    private String message;

    private ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }
    public String message() {
        return this.message;
    }
}
